import request from '@/utils/request'
import Cookies from 'js-cookie'
var  adminName=Cookies.get('adminName')
var  token=Cookies.get('token')
//礼物获取列表
export function getAll(data){
  return request({
    url:'/api/admin/gift/getAll',
    method:'post',
    data:{
      adminName:data.adminName,
      token:data.token,
    }
  })
}
//删除礼物
export function Gdel(e,admin){
  return request({
    url:'/api/admin/gift/delete',
    method: 'post',
    data:{id:e,
   adminName:admin.adminName,
   token:admin.token,}
  })
}
//修改礼物
export function GmodOne(data,admin){
  console.log(2222)
  console.log(data)
  return request({
    url:'/api/admin/gift/modOne',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      gift:data
    }
  })
}
//添加礼物
export function Gadd(data,admin){
  console.log(admin)
  return request({
    url:'/api/admin/gift/add',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      gift:data
    }
  })
}
//修改状态
export function enable_set(date,admin){
  return request({
    url:'/api/admin/gift/enable/set',
    method:'post',
    data:{
  adminName:admin.adminName,
      token:admin.token,
      id:date.id,
      enable:date.enable
    }
  })
}
//获取游戏信息
export function cube_getAll(admin){
  return request({
    url:'/api/admin/cube/getAll',
    method:'post',
    data:{
  adminName:admin.adminName,
      token:admin.token,
    }
  })
}
//修改游戏信息
export function cube_mod(data,admin){
  return request({
    url:'/api/admin/cube/mod',
    method:'post',
    data:{
  adminName:admin.adminName,
      token:admin.token,
      cubes:data
    }
  })
}
//注销用户
export function cancelled(data,admin){
  return request({
    url:'/api/admin/user/cancelled',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      userId:data.userId
    }
  })
}
//实名认证列表
export function realNameAuth(data,admin){
  console.log(data)
  return request({
    url:'/api/admin/user/realNameAuth/list/get',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      status:data
    }
  })
}
// 实名认证操作
export function deal(data,admin,page){
  return request({
    url:'/api/admin/user/realNameAuth/deal',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      status:data.status,
      reason:data.reason,
      id:data.id,
      pageNum:page.pageIndex,
      pageSize:page.pageSize
     }
  })
}
//获取工会列表
export function unionListPost(data,admin,page){
  return request({
    url:'/api/admin/union/getList',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      pageNum:page.pageIndex,
      pageSize:page.pageSize,
      telephone:data
    }
  })
}
//解散工会
export function shutdown(data,admin){
  return request({
    url:'/api/admin/union/shutdown',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      unionId:data.unionId,
      shtReason:data.shtReason
    }
  })
}
//创建工会
export function Uncreate(data,admin){
  return request({
    url:'/api/admin/union/create',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      telephone:data
    }
  })
}
//获取用户
export function UserGet(admin,page){
  return request({
    url:'/api/admin/user/get',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      pageIndex: page.pageIndex,
      pageSize: page.pageSize
    }
  })
}
//用户打赏纪录
export function getRecords(data,admin,page){
  return request({
    url:'/api/admin/gift/send/getRecords',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      pageNum: page.pageIndex,
      pageSize: page.pageSize,
      userId:data
    }
  })
}
//主播收礼纪录
export function RgetRecords(data,admin,page){
  return request({
    url:'/api/admin/gift/receive/getRecords',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      pageNum: page.pageIndex,
      pageSize: page.pageSize,
      userId:data
    }
  })
}
//在播房间
export function living(admin,page){
  return request({
    url:'/api/admin/user/get/living',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      pageNum: page.pageIndex,
      pageSize: page.pageSize,
    }
  })
}
//中奖纪录
export function recordList(admin,page){
  return request({
    url:'/api/admin/cube/draw/record/list',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      pageNum: page.pageIndex,
      pageSize: page.pageSize,
    }
  })
}
//工会成员
export function getMembers(data,admin,page){
  return request({
    url:'/api/admin/union/getMembers',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      pageNum: page.pageIndex,
      pageSize: page.pageSize,
      unionId:data
    }
  })
}
//强制下播
export function Forceddowncast(data,admin){
  return request({
    url:'/api/admin/room/manage/forceStop',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      roomId:data.roomId,
      reason:data.reason
    }
  })
}
//修改轮播图
export function CarouselMod(data,admin){
  return request({
    url:'/api/admin/carousel/mod',
    method:'post',
    data:{
      adminName:admin.adminName,
      token:admin.token,
      id:data.id,
      linkUrl:data.linkUrl,
      description:data.description,
      title:data.title,
      picPath:data.picPath,
      orderNo:data.orderNo
    }
  })
}
